package aip2011.controller.rifugio;

import java.util.ArrayList;
import java.util.List;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

import aip2011.model.Rifugio;
import aip2011.service.RifugioService;

public class ZonaController extends Controller {
   
    public RifugioService service=new RifugioService();

    @Override
    public Navigation run() throws Exception {
        
        List<Rifugio> rif=service.getRifugiList();
        List<String> zone=new ArrayList<String>();
       
        for(Rifugio r:rif){
            if(!zone.contains(r.getZona())){
                zone.add(r.getZona());
            }
           
        }
        requestScope("zone",zone);
        return forward("zona.jsp");
    }
}
